package org.fuys.coder.infrastructure.hook;

import org.fuys.coder.infrastructure.scheduled.HotRank;
import org.fuys.coder.infrastructure.scheduled.PreLoadRecommendSubstance;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.common.hook
 * @className: PreHandleHook
 * @author: WangJing
 * @description: 应用启动前预处理钩子
 * @date: 2024/9/4 15:33
 * @version: 1.0
 */
@Component
public class PreHandleHook implements CommandLineRunner {

    @Resource
    private HotRank hotRank;

    @Resource
    private PreLoadRecommendSubstance preLoadRecommendSubstance;

    @Override
    public void run(String... args) throws Exception {
        hotRank.hotRank();
        preLoadRecommendSubstance.preLoad();
    }
}
